Transaction Upserted Event
Apart from Custom Events that could be integrated within Insight Factory System there is a defined, built-in Transaction Upserted event, informing about transaction being inserted or updated. When the Meniga Services Transaction Integration event occurs, it is being transformed by External Events Consumer to the Transaction Upserted event. Then the transformed even is sent to Triggering Engine, where evaluation process of corresponding active Insight Definitions takes place.
public record TransactionsUpsertedEvent
{
public IEnumerable<Transaction> UpsertedTransactions { get; init; }
public string ExternalMessageId { get; init; }
public UserIdentity User { get; init; }
}
Property | Description |
---|---|
UpsertedTransactions | Collection of updated or inserted transactions. |
ExternalMessageId | Identifier of the message passed to the External Events Consumer component. |
User | Describes the identity of the user transactions are made for. |
UserIdentity schema
public record UserIdentity
{
public long Id { get; init; }
public string Identifier { get; init; }
public string Tenant { get; init; }
public string ShardingKey { get; init; }
}
Property | Description |
---|---|
Id | Unique numeric identifier of the user (used internally). |
Identifier | Unique text identifier of the user. |
Tenant | Tenant which a given user is assigned to. |
ShardingKey | Value indicating which database stores information about a given user. |
Transaction schema
public record Transaction
{
public long Id { get; init; }
public decimal Amount { get; init; }
public decimal SplitRatio { get; init; }
public decimal? BookedAmount { get; init; }
public decimal? AmountInCurrency { get; init; }
public string? Currency { get; init; }
public DateTime TransactionDate { get; init; }
public DateTime? BookingDate { get; init; }
public DateTime? ValueDate { get; init; }
public DateTime? ExecutionDate { get; init; }
public DateTime BudgetDate { get; init; }
public DateTime InsertedDate { get; init; }
public DateTime? ModifiedDate { get; init; }
public string Text { get; init; }
public string OriginalText { get; init; }
public string? CountryCode { get; init; }
public string? Mcc { get; init; }
public bool? IsMerchant { get; init; }
public bool? IsUncleared { get; init; }
public bool? IsOwnAccountTransfer { get; init; }
public bool IsRead { get; init; }
public long CategoryId { get; init; }
public double CategoryAccuracy { get; init; }
public Category[] DetectedCategories { get; init; }
public Account Account { get; init; }
public Counterparty? CounterParty { get; init; }
public IReadOnlyDictionary<string, string>? CustomData { get; init; }
public IReadOnlyDictionary<string, string>? NormalizedFields { get; init; }
public Merchant? Merchant { get; init; }
public User User { get; init; }
public int Version { get; init; }
}
Property | Description |
---|---|
Id | Unique identifier of the transaction. |
Amount | The original amount of the transaction in user currency. |
SplitRatio | Tells from 0.0 to 1.0 how the Amount, BookedAmount and AmountInCurrency have been split between categories. Value is 1.0 if the transaction has not been split. |
BookedAmount | The original amount of the transaction in the Account.Currency. |
AmountInCurrency | The original amount of the transaction in the transaction's Currency. |
Currency | ISO 4217 Alpha 3 currency code of the AmountInCurrency. |
TransactionDate | The date of the transaction. |
BookingDate | The booking date of the transaction. |
ValueDate | The value date of the transaction. |
ExecutionDate | The execution date of the transaction. |
BudgetDate | The date of the transaction used in most business modules, e.g. to calculate the budget or to sum up for reports. |
InsertedDate | The date when the transaction was stored in the Meniga Database. |
ModifiedDate | The date when the transaction was modified in the Meniga Database. |
Text | The enriched text of the transaction. |
OriginalText | The original text of the transaction. |
CountryCode | The ISO 3166-1 alpha-2 code for the country this transaction originates from. |
Mcc | The ISO 18245 Merchant Category Code. |
IsMerchant | true if the transaction is linked to a merchant, false if we know it is not linked to a merchant and null if there is no information. Either set by the external data source or set to true through the Transaction Enrichment Process. |
IsUncleared | true if the transaction has not been cleared in the banking systems, e.g. if it is a reservation. false if the transaction has been cleared. null if there is no information. |
IsOwnAccountTransfer | true if it is known that the transaction was made between two accounts that the User owns, false if it is know it was not, null it it is unknown. |
IsRead | true if the user has seen and reviewed the transaction. |
CategoryId | The id of the categorization assigned in the enrichment process. The top scoring category from the DetectedCategories is assigned. The category can also be changed by the user. |
CategoryAccuracy | Tells from 0.0 to 1.0 how accurate the categorization of the transaction is. |
DetectedCategories | Tells what categories were detected in the enrichment process and their scores. Schema of Category type could be found here. |
Account | Account that transaction is inserted to or updated. Schema of Account type could be found here. |
CounterParty | Information on the counter party of the transaction. Schema of CounterParty type could be found here. |
CustomData | List of custom data that is not part of the top-level transaction object. The available property names depend on the external data source. This object can have N many different property names. |
NormalizedFields | List of custom data captured by the Transaction Normalization Rules that run as part of the enrichment process. The available property names depend on what the Normalization Rules output as normalized fields. The total length of the data contained in the normalized fields key + values is 2000 characters. This object can have N many different property names. |
Merchant | The merchant that has been linked to the transaction through the enrichment process. Schema of Merchant type could be found here. |
User | Information about the user who owns the data in the message. Schema of User type could be found here. |
Version | The change history version of the current transaction that is incremented for each operation performed on the transaction. |
Account schema
public record Account
{
public long Id { get; init; }
public string ExternalIdentifier { get; init; }
public long AccountTypeId { get; init; }
public string Name { get; init; }
public string Currency { get; init; }
public decimal Balance { get; init; }
public Balance[] Balances { get; init; }
public decimal? Limit { get; init; }
public bool IsDisabled { get; init; }
public int? RealmId { get; init; }
public long? RealmUserId { get; init; }
public string? RealmUserIdentifier { get; init; }
public string? RealmIdentifier { get; init; }
public int Version { get; init; }
}
Property | Description |
---|---|
Id | The identifier of the account. Only unique per User.Id. |
ExternalIdentifier | A unique identifier from the external data source of the account. |
AccountTypeId | The Meniga Account Type id of the account. |
Name | The name of the account. |
Currency | The currency code the account. ISO 4217 Alpha 3 currency code. |
Balance | The balance of the account after the transaction was imported. |
Balances | The different types of balances of the account after the transaction was imported. Schema of Balance type could be found here. |
Limit | The limit of the account. |
IsDisabled | true if the this account should be excluded from all calculations. |
RealmId | A unique id of the external data source that realm users and their data can be loaded from. If the RealmUserId field has a value then this field is required, else optional. |
RealmUserId | An identifier of the Realm User in the Meniga Database, only unique per User.Id. |
RealmUserIdentifier | The identifier of the user within the external data source, only unique within the given RealmIdentifier. If the RealmUserId field has a value then this field is required, else optional. |
RealmIdentifier | A unique identifier of the external data source that realm users and their data can be loaded from. If the RealmUserId field has a value then this field is required, else optional. |
Version | The change history version of the current account that is incremented for each operation performed on the account or the transactions that belong to the account. |
Balance schema
public record Balance
{
public decimal Amount { get; init; }
public DateTime Date { get; init; }
public string Type { get; init; }
public string Currency { get; init; }
}
Property | Description |
---|---|
Amount | The balance of the account after the transaction was imported. |
Date | The date of the balance. |
Type | The type of the balance according to ISO20022 standard for defining balance types, possible values ['closing-booked','expected','authorised','opening-booked','interim-available','forward-available']. |
Currency | The currency of the Amount. ISO 4217 Alpha 3 currency code. |
Category schema
public record Category
{
public int Id { get; init; }
public double Score { get; init; }
}
Property | Description |
---|---|
Id | The id of the category. |
Score | Tells from 0.0 to 1.0 how relevant this category is to the transaction. |
Counterparty schema
public record Counterparty
{
public string? Name { get; init; }
public string? AccountIdentifier { get; init; }
public string? IdentifierType { get; init; }
}
Property | Description |
---|---|
Name | The name of the counter party. |
AccountIdentifier | A unique identifier of the account in the external source system. |
IdentifierType | The type of the counter party account identifier. Values can be: "iban", "bban", "pan", "maskedPan", "msisdn", "custom". |
Merchant schema
public record Merchant
{
public long Id { get; init; }
public string? Name { get; init; }
public MerchantParent? Parent { get; init; }
}
Property | Description |
---|---|
Id | The id of the merchant. Unique per setup of Merchant Mapping Service. |
Name | The name of the merchant. |
Parent | The merchant that is the parent merchant of the merchant.Schema of MerchantParent type could be found here. |
Merchant parent schema
public record MerchantParent
{
public long Id { get; init; }
public string? Name { get; init; }
}
Property | Description |
---|---|
Id | The id of the merchant. Unique per setup of Merchant Mapping Service. |
Name | The name of the merchant. |
User schema
public record User
{
public long Id { get; init; }
public string Identifier { get; init; }
public string Currency { get; init; }
public string ShardingKey { get; init; }
public string Tenant { get; init; }
}
Property | Description |
---|---|
Currency | Currency assigned to user. |
Id/Identifier/ShardingKey/Tenant | Properties are the same as in UserIdentity. |